Introduction to QuickTime 3 for Windows Programmers

Previous | Overview | Contents | Next

Redefined API Names

Some names defined in the Macintosh application programming interfaces conflict with identical names in the Windows API. In these cases, the QTML header file QTMLMapNames.h avoids these conflicts by redefining the affected names with the prefix Mac added. In Table A-1 , names listed in the first column refer to the original Macintosh function or data structure name; the second column gives the redefined or newly mapped names.

Table A-1 Redefined API names

Original Macintosh API name

Mapped name

AnimatePalette MacAnimatePalette
AppendMenu MacAppendMenu
CloseDriver MacCloseDriver
CloseWindow MacCloseWindow
CompareString MacCompareString
CopyRgn MacCopyRgn
DeleteMenu MacDeleteMenu
DrawMenuBar MacDrawMenuBar
DrawText MacDrawText
EqualRect MacEqualRect
EqualRgn MacEqualRgn
FillRect MacFillRect
FillRgn MacFillRgn
FindWindow MacFindWindow
FlushInstructionCache MacFlushInstructionCache
FrameRect MacFrameRect
FrameRgn MacFrameRgn
GetClassInfo MacGetClassInfo
GetCurrentThread MacGetCurrentThread
GetCursor MacGetCursor
GetDoubleClickTime MacGetDoubleClickTime
GetFileSize MacGetFileSize
GetItem MacGetItem
GetMenu MacGetMenu
GetNextWindow MacGetNextWindow
GetParent MacGetParent
GetPath MacGetPath
GetPixel MacGetPixel
InsertMenu MacInsertMenu
InsertMenuItem MacInsertMenuItem
InsetRect MacInsetRect
InvertRect MacInvertRect
InvertRgn MacInvertRgn
IsWindowVisible MacIsWindowVisible
LineTo MacLineTo
LoadResource MacLoadResource
MoveWindow MacMoveWindow
OffsetRect MacOffsetRect
OffsetRgn MacOffsetRgn
OpenDriver MacOpenDriver
PaintRgn MacPaintRgn
Polygon MacPolygon
PtInRect MacPtInRect
Region MacRegion
ReplaceText MacReplaceText
ResizePalette MacResizePalette
SendMessage MacSendMessage
SetCursor MacSetCursor
SetItem MacSetItem
SetPort MacSetPort
SetRect MacSetRect
SetRectRgn MacSetRectRgn
ShowCursor MacShowCursor
ShowWindow MacShowWindow
StartSound MacStartSound
StopSound MacStopSound
TokenType MacTokenType
UnionRect MacUnionRect
UnionRgn MacUnionRgn
XorRgn MacXorRgn

Four-character codes like the ones that represent resource types are used on the Mac OS platform for a wide variety of other purposes as well. For example, every file is stamped with a four-character file type and a four-character creator signature identifying the application program to which the file belongs; these play an analogous role on the Mac OS platform to the three-character file-name extension in the DOS/Windows file system.

QuickTime uses four-character codes to identify such things as track types, media types, and component types. Internally, such codes are simply 32-bit long integers; at the source-language level, they are typically represented by a string of four characters enclosed in single quotation marks, such as 'abcd' .

Because DOS/Windows files don't have a counterpart to the Macintosh resource fork, other mechanisms have to be adopted to accommodate resource information. For example, although QuickTime movie files use both forks on the Mac OS platform, those on Windows have only the equivalent of the data fork. One approach is to store only the contents of the data fork from the Mac OS movie file into the corresponding Windows movie file (extension .mov ), while storing the resource fork into a companion file with extension .qtr ("QuickTime resources"). If a needed resource cannot be found in the .mov file, the QTML resource-handling routines will automatically look for a matching .qtr file and will attempt to locate the resource there. The drawback to this approach is that the user, when moving or copying a movie file from one place to another, must remember to move the matching resource file along with it. This is a nuisance to the user and is likely to lead to dissatisfaction with your application.

Fortunately, QuickTime supports another solution to the cross-platform resource problem. The QuickTime function FlattenMovie (described in Inside Macintosh: QuickTime and QuickTime 3 Reference) allows you to create a single-fork movie file with an empty resource fork and all of the resource data stored in the data fork instead. The resulting file can then be transported to Windows (or other platforms) without losing any of the movie's data. This is generally a better solution for cross-platform compatibility, since it requires the user to move one file instead of two.


© 1997 Apple Computer, Inc.

Previous | Overview | Contents | Next